package com.tansun.easycare.rule.approval.entity;

import org.drools.core.util.StringUtils;

import com.alibaba.fastjson.JSON;
import com.tansun.easycare.rule.rulemange.entity.RuleManage;
import com.tansun.rule.common.RuleModelTypeEnum;

public class RuleManageInfo extends RuleManage {

    /**
	 * 
	 */
	private static final long serialVersionUID = -5487693041638722352L;
	private String isCheck;
	private String modelTypeCN;
	
    public String getIsCheck() {
        return isCheck;
    }

    public void setIsCheck(String isCheck) {
        this.isCheck = isCheck;
    }

    @Override
    public String toString() {

        RuleManageInfo info = new RuleManageInfo();
        info.setId(this.id);
        info.setCode(this.getCode());
        info.setName(this.getName());
        info.setModelType(this.getModelType());
        info.setProjectCode(this.getProjectCode());
        info.setVersion(this.getVersion());
        info.setActiveVersion(this.getActiveVersion());
        info.setUpdateDate(this.getUpdateDate());
        info.setUsers(this.getUsers());

        return JSON.toJSONString(info);
    }
	public String getModelTypeCN() {
		if(StringUtils.isEmpty(super.getModelType()))
			return "";
		RuleModelTypeEnum ruleenum = RuleModelTypeEnum.getRuleModelTypeEnum(super.getModelType());
		if(ruleenum==null)
			return super.getModelType();
		this.modelTypeCN = ruleenum.getName();
		return this.modelTypeCN;
	}

	public void setModelTypeCN(String modelTypeCN) {
		this.modelTypeCN = modelTypeCN;
	}
}
